﻿<%@ Control Language="C#" ClassName="PaymentsSummary" Inherits="Dimok.Web.UI.TableControl" %>
<script runat="server">
	protected override void OnInit(EventArgs e) {
		base.OnInit(e);
		Page.LoadComplete += new EventHandler(Page_LoadComplete);
	}

	void Page_LoadComplete(object sender, EventArgs e) {
		GridViewEx.DataBind();
	}
	public int LoanID { get { return (int)Lib.GetProperty(Parent, "LoanID"); } }
</script>
<style>
	.GridView TR.PaymentSummaryHeader TH{background-color:#f1f1e4}
	.GridView TR.PaymentSummaryHeader TD{text-align:center}
</style>
<asp:UpdatePanel ID="upPaymentsSummary" UpdateMode="Always" runat="server">
	<ContentTemplate>
<UI:GridViewEx DataSourceID="dsPaymentsSummary" RowStyle-BackColor="#f1f1e4" RowStyle-HorizontalAlign="Center"
		RowStyle-Font-Bold="true" HeaderStyle-CssClass="PaymentSummaryHeader"
		AllowEdit="false" ShowDelete="false" AllowSorting="true" ShowSearch="false" AutoGenerateColumns="false" runat="server">
<Columns>
<asp:BoundField DataField="LoanState" HeaderText="Loan<BR/>State" SortExpression="LoanState" HtmlEncode="false" />
<asp:BoundField DataField="Payment" HeaderText="Payment" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="Payment" />
<asp:BoundField DataField="PaymentsCount" HeaderText="<span title='Payments Count'>Pmts<BR/>#</span>" HtmlEncode="false" SortExpression="PaymentsCount" />
<asp:BoundField DataField="PaymentsCountByPrincipal" HeaderText="<span title='Payments Count By Principal'>Pmts<BR/>#(P)</span>" DataFormatString="{0:n2}" HtmlEncode="false" SortExpression="PaymentsCountByPrincipal" />
<asp:BoundField DataField="DPD" DataFormatString="{0:n0}" HeaderText="DPD" ItemStyle-HorizontalAlign="Center" SortExpression="DPD" />
<asp:BoundField DataField="DatePaid" HeaderText="Date<BR/>Paid" DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="false" SortExpression="DatePaid" />
<asp:BoundField DataField="DateNext" HeaderText="Date<BR/>Next" DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="false" SortExpression="DateNext" />
<asp:BoundField DataField="PrincipalBalance" HeaderText="Principal<BR/>Balance" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="PrincipalBalance" />
<asp:BoundField DataField="ExpectedBalance" HeaderText="Expected<BR/>Balance" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="ExpectedBalance" />
<asp:BoundField DataField="PaymentBalance" HeaderText="Payment<BR/>Balance" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="PaymentBalance" />
<asp:BoundField DataField="InterestEarned" HeaderText="Interest<BR/>Earned" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="InterestEarned" />
<asp:BoundField DataField="InterestUnpaid" HeaderText="Interest<BR/>Unpaid" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="InterestUnpaid" />
<asp:BoundField DataField="LateFeeEarned" HeaderText="LateFee<BR/>Earned" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="LateFeeEarned" />
<asp:BoundField DataField="LateFeeUnpaid" HeaderText="LateFee<BR/>Unpaid" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="LateFeeUnpaid" />
<asp:BoundField DataField="NSFFeeEarned" HeaderText="NSFFee<BR/>Earned" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="NSFFeeEarned" />
<asp:BoundField DataField="NSFFeeUnpaid" HeaderText="NSFFee<BR/>Unpaid" DataFormatString="{0:c2}" HtmlEncode="false" SortExpression="NSFFeeUnpaid" />
</Columns>
</UI:GridViewEx>
</ContentTemplate>
</asp:UpdatePanel>
<DS:FunctionDataSource EnableCaching="false" ID="dsPaymentsSummary" SelectViewName="PaymentsSummary(@ID)" runat="server"
>
	<SelectParameters>
		<asp:ControlParameter PropertyName="Page.LoanID" Name="ID" Type="Int32" />
	</SelectParameters>
</DS:FunctionDataSource>
